#include "SysConstants.h"
#include "helper/CryptHelper.h"

const SysConstants::SysConst SysConstants::constants;

SysConstants::SysConstants(QObject* parent)
    : QObject(parent)
{
    // 初始化代码
}

// === 属性访问器实现 ===
QString SysConstants::sysName() const
{
    return constants.sysName;
}

QString SysConstants::displayName() const
{
    return constants.displayName;
}

QString SysConstants::company() const
{
    return constants.company;
}

QString SysConstants::sysVersion() const
{
    return constants.sysVersion;
}

QString SysConstants::sysCopyright() const
{
    return constants.sysCopyright;
}

QString SysConstants::licenseInfo() const
{
    return constants.licenseInfo;
}

QString SysConstants::sysCopyrightUrl() const
{
    return constants.sysCopyrightUrl;
}

QString SysConstants::sysDescription() const
{
    return constants.sysDescription;
}

// 单例实例化函数
// SysConstants* SysConstants::instance(QQmlEngine* engine, QJSEngine* scriptEngine)
// {
//     Q_UNUSED(engine);
//     Q_UNUSED(scriptEngine);

//     static SysConstants instance;
//     return &instance;
// }

QString SysConstants::getDefaultPassword() const
{
    const QString password = "123456";
    return CryptHelper::sm3Hash(password.toUtf8()).toHex();
}
